import _ from 'lodash';

const DOMAIN = "https://www.stprgm.cn";
const PROJECT_ROOT_NAME = "manage";
let HTTP_CONFIG_DOMAIN = "";
let HTTP_CONFIG_CONTEXT = "";
if(process.env.NODE_ENV === 'production'){
    HTTP_CONFIG_DOMAIN = DOMAIN + "/web";
}else{
    // HTTP_CONFIG_DOMAIN = "http://127.0.0.1:8009";
    HTTP_CONFIG_DOMAIN = DOMAIN + "/web";
}

const HTTP_HEAD_LOGIN_NAME = "Login-Token";


const config = new Object();
(function(w){
    w.HTTP_HEAD_LOGIN_NAME = "Login-Token";
    
    w.requestConfig = {
        headLoginName : HTTP_HEAD_LOGIN_NAME,
        httpDomain : HTTP_CONFIG_DOMAIN,
        httpContext : HTTP_CONFIG_CONTEXT,
        httpBaseUrl : HTTP_CONFIG_DOMAIN + HTTP_CONFIG_CONTEXT
    }
    w.domain = DOMAIN;

    /**
     * 页面根目录名称 
     */
    w.projectRootName = PROJECT_ROOT_NAME;

    /**
     * 页面的大小信息
     */
    w.pageSizeMsg = {
        width : document.body.clientWidth,
        height : document.body.clientHeight
    };

    /** 首页 */
    w.INDEX_PATH = "/";
})(config)
export {config};